VT-d: use two 32-bit writes to update DMAR fault address registers
authorHaozhong Zhang <haozhong.zhang@intel.com>
Fri, 23 Feb 2018 09:59:31 +0000 (10:59 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 23 Feb 2018 09:59:31 +0000 (10:59 +0100)
commitc99775d597fae9b8b8b27827b3d7845c49a2a0d7
tree1dc1724e232ad5835e5cb0789d58b77d670184bd
parentda3d180d101cf81d085f0c6560d70acd16c934bd
VT-d: use two 32-bit writes to update DMAR fault address registers

The 64-bit DMAR fault address is composed of two 32 bits registers
DMAR_FEADDR_REG and DMAR_FEUADDR_REG. According to VT-d spec:
"Software is expected to access 32-bit registers as aligned doublewords",
a hypervisor should use two 32-bit writes to DMAR_FEADDR_REG and
DMAR_FEUADDR_REG separately in order to update a 64-bit fault address,
rather than a 64-bit write to DMAR_FEADDR_REG. Note that when x2APIC
is not enabled DMAR_FEUADDR_REG is reserved and it's not necessary to
update it.

Though I haven't seen any errors caused by such one 64-bit write on
real machines, it's still better to follow the specification.

Fixes: ae05fd3912b ("VT-d: use qword MMIO access for MSI address writes")
Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/drivers/passthrough/vtd/iommu.c